<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>

<img src="images/title9.gif" alt="" width="235" height="41" />
<logic:present  name="cartCar">
    <form action="CarOrder.do" method="post">
        <TABLE class="table0" cellSpacing=0 cellPadding=0 align=center bgcolor="#FFFFFF">
            <TR>
                <TD class="td1"></TD>

                <TD class="top"></TD>
                <TD class="topright"></TD>
            </TR>
            <TR>
                <TD class="middleleft" rowSpan=3></TD>
                <TD bgcolor="#F0F0F0">
                    <center> <h4>Information CarBook</h4></center>


                </TD>
                <TD class="middleright" rowSpan=3></TD>
            </TR>
            <TR>
                <TD class="middlecenter"></TD>
            </TR>
            <TR>
                <TD class="main">
                    <table width="580" border="0">
                        <tr>
                            <td>Car name </td>
                            <td>Price </td>
                            <td>Auantity</td>
                            <td>Driver</td>
                            <td>Pickup date </td>
                            <td>Dropoff date </td>
                            <td>Total</td>
                        </tr>
                        <logic:iterate id="cartCar" name="cartCar">
                            <tr>
                                <td><bean:write name="cartCar" property="carsDTO.carName"/></td>
                                <td><input  type="text" readonly size="5"  id="price<bean:write name="cartCar" property="carId"/>" name="price<bean:write name="cartCar" property="carId"/>" value="<bean:write name="cartCar" property="carsDTO.price"/>"></td>
                                <td>
                                    <input  type="text" readonly size="5" id="qty<bean:write name="cartCar" property="carId"/>" name="qty<bean:write name="cartCar" property="carId"/>" value="<bean:write name="cartCar" property="qty"/>">
                                </td>
                                <td><logic:equal name="cartCar" property="driver" value="0">
                                        <input type="text" readonly size="5" name="driver<bean:write name="cartCar" property="carId"/>" id="driver<bean:write name="cartCar" property="carId"/>" value="No">
                                    </logic:equal>
                                    <logic:equal name="cartCar" property="driver" value="1">
                                        <input type="text" readonly size="5" name="driver<bean:write name="cartCar" property="carId"/>" id="driver<bean:write name="cartCar" property="carId"/>" value="Yes">
                                    </logic:equal>
                                </td>
                                <td><input type="text" readonly size="10"  id="pickup<bean:write name="cartCar" property="carId"/>" name="pickup<bean:write name="cartCar" property="carId"/>" value="<bean:write name="cartCar" property="pickUpdate"/>">
                                </td>
                                <td>
                                    <input type="text" readonly size="10" id="dropoff<bean:write name="cartCar" property="carId"/>" name="dropoff<bean:write name="cartCar" property="carId"/>" value="<bean:write name="cartCar" property="dropOffDate"/>">
                                </td>
                                <td>
                                    <input readonly type="text" style="color:#FF0000" id="total<bean:write name="cartCar" property="carId"/>" name="total<bean:write name="cartCar" property="carId"/>" value="<bean:write name="cartCar" property="total"/>">
                                </td>
                            </tr>
                        </logic:iterate>

                    </table>
                </TD>
            </TR>

            <TR>
                <TD class="bottom"><IMG border=0 alt="" src="img/pod_main_bottom_left.gif"></TD>
                <TD class="bottomright"><P align=right>&nbsp;</P></TD>
                <TD class="bottomleft"><IMG border=0 alt="" src="img/pod_main_bottom_right.gif"></TD>
            </TR>
        </TABLE>
        <input type="button" value="Edit Order" onclick="history.back();">  <br/>
        <br/>
        Booking date : ${carOrder.orderDate} &nbsp;&nbsp;&nbsp; Amount : &nbsp;${carOrder.amount}
        <br/><br/>
        <b> <font color="red">Your infomation:<br/></font></b>
        <TABLE class="table0" cellSpacing=0 cellPadding=0 align=center bgcolor="#FFFFFF">
            <TR>
                <TD class="td1"></TD>

                <TD class="top"></TD>
                <TD class="topright"></TD>
            </TR>
            <TR>
                <TD class="middleleft" rowSpan=3></TD>
                <TD bgcolor="#F0F0F0">
                    <center> <h4>Information Customers</h4></center>

                </TD>
                <TD class="middleright" rowSpan=3></TD>
            </TR>
            <TR>
                <TD class="middlecenter"></TD>
            </TR>
            <TR>
                <TD class="main">
                    <table width="580" border="0" cellpadding="0" cellspacing="0">
                        <!--DWLayoutTable-->
                        <tr>
                            <td >Full name </td>
                            <td ><input type="text"   size="18" name="fullName" id="fullName" readonly value="${cus.fullName}"></td>
                        </tr>
                        <tr><td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td >Email </td>
                            <td ><input type="text" size="27" name="email" id="email" readonly value="${cus.email}">
                                Phone
                                <input type="text" name="phone" id="phone" readonly value="${cus.phone}">
                                Fax<input type="text" name="fax" id="fax" readonly value="${cus.fax}">
                            </td>
                        </tr>
                        <tr><td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td >Birth date</td>
                            <td >
                                <input type="text" name="birth" id="birth" size="50" readonly value="${cus.birthDay}">
                            </td>
                        </tr>
                        <tr><td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td >Country/Region <font color="red">*</font></td>
                            <td >
                                <input type="text" name="country" readonly value="${cus.country}">
                            </td>
                        </tr>
                        <tr><td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td >State/Province</td>
                            <td ><input type="text" name="state" id="state" size="15" readonly value="${cus.state}"></td>
                        </tr>
                        <tr><td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>Address</td>
                            <td ><input type="text" name="add" id="add" readonly value="${cus.address}" size="80"></td>
                        </tr>
                        <tr><td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td >Job</td>
                            <td >
                                <input type="hidden" name="jobId" id="jobId" value="${cus.jobDTO.jobId}">
                                <input type="text" id="jobName" name="jobName" readonly value="${cus.jobDTO.jobName}">
                            </td>
                        </tr>
                        <tr><td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td  colspan="2"><input type="checkbox" name="ok" value="1" id="ok">I gree</td>
                        </tr>
                        <tr>
                            <td  colspan="2"><input type="submit" value="Confirm" name="action" onclick="return checkform()"></td>
                        </tr>
                    </table>
                </TD>
            </TR>

            <TR>
                <TD class="bottom"><IMG border=0 alt="" src="img/pod_main_bottom_left.gif"></TD>
                <TD class="bottomright"><P align=right>&nbsp;</P></TD>
                <TD class="bottomleft"><IMG border=0 alt="" src="img/pod_main_bottom_right.gif"></TD>
            </TR>
        </TABLE>

    </form>

</logic:present>
<logic:notPresent name="cartCar">
    You not Yourcart
</logic:notPresent>
<script >
    function checkform(){
        if(document.getElementById('ok').checked == true){
            return true;
        }
        else{
            alert("Please check the checkbox");
            return false;
        }

    }
</script>